package entity

import "time"

// 部门
type SysDept struct {
	Model
	Name     string `json:"name" gorm:"name"`
	Code     string `json:"code"`
	ParentId uint64 `json:"parentId" gorm:"parent_id"`
	TreePath string `json:"treePath" gorm:"tree_path"`
	Sort     int16  `json:"sort"`
	Status   uint8  `json:"status"`
}

func (SysDept) TableName() string {
	return "sys_dept"
}

type DeptQuery struct {
	Keywords *string `json:"keywords" form:"keywords"` //关键字(菜单名称)
	Status   *int8   `json:"status" form:"status"`     //状态(1->显示；0->隐藏)
}

type DeptVO struct {
	ID         uint64    `gorm:"primary_key" json:"id"`
	ParentId   uint64    `json:"parentId" gorm:"parent_id"`
	Name       string    `json:"name" gorm:"name"`
	Code       string    `json:"code"`
	Sort       int16     `json:"sort"`
	Status     uint8     `json:"status"`
	Children   []DeptVO  `json:"children"`
	CreateTime time.Time `json:"createTime" gorm:"column:create_time;type:datetime;autoCreateTime"`
	UpdateTime time.Time `json:"updateTime" gorm:"column:update_time;type:datetime;autoCreateTime"`
}

type DeptForm struct {
	ID       uint64 `gorm:"primary_key" json:"id"`
	Name     string `json:"name" gorm:"name"`
	Code     string `json:"code"`
	ParentId uint64 `json:"parentId" gorm:"parent_id"`
	Sort     int16  `json:"sort"`
	Status   uint8  `json:"status"`
}
